package com.prasad.java;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class OverrideHashcodeEquals {
	
	public static void main(String[] args) {
		
		ArrayList<String> list1 = new ArrayList<String>();
		list1.add("java");
		list1.add("prasad");
		list1.add("java");
		

		ArrayList<String> list2 = new ArrayList<String>();
		list2.add("java");
		list2.add("prasad");
		list2.add("java");
		
		Map<ArrayList<String>, String> map = new HashMap<ArrayList<String>, String>();
		
		map.put(list1, "l1");
		map.put(list2, "l2");
		
		System.out.println(map);
		
		Person p1 = new Person("A","M");
		Person p2 = new Person("B","M");
		
		Map<Person, String> map1 = new HashMap<Person, String>();
		
		map1.put(p1, "per1");
		map1.put(p2, "per2");
		
		System.out.println(map1);
		System.out.println(p1.hashCode()+" "+p2.hashCode());	
	}
}
